#-*- coding: utf-8 -*-
# This is a fake, just to set database engine in tests
import os
from tempfile import gettempdir

# Get all data from original settings
exec('from %s import *' % (os.getenv('SELENOSE_SETTINGS_MODULE')))

# Update database settings
for alias in DATABASES:
    # Set the engine
    DATABASES[alias]['ENGINE'] = 'django.db.backends.sqlite3'
    # Fake database (not used)
    DATABASES[alias]['NAME'] = os.path.join(gettempdir(), 'selenose_%s.dbs' % alias)

# Add SELENOSE application to have E-mail support
INSTALLED_APPS += ('selenose', )

# Define E-mail back end
EMAIL_BACKEND = 'selenose.mail.EmailBackend'